/*
 * @Author: your name
 * @Date: 2022-02-10 16:23:52
 * @LastEditTime: 2022-02-10 18:22:57
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \jike\src\App.js
 */

import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Login from './pages/Login';
import Layout from './pages/Layout';
import AuthRoute from './components/AuthRoute';
export default class App extends Component {
  render() {
    return (
      <Router>
        <Switch>
          <Route path="/login" component={Login}></Route>
          <AuthRoute path="/" component={Layout}></AuthRoute>
        </Switch>
      </Router>

      // React路由的使用口诀：
      // 1. Router代表实例化组件，整个项目只用一次
      // 2. Router包住所有的diam
      // 3. Switch包住所有的Route组件
    );
  }
}

/* React路由中，匹配任意路径的写法:3种 */
/* <Route component={() => <h1>匹配任意路径</h1>}></Route> */
/* <Route path="*" component={() => <h1>匹配任意路径</h1>}></Route> */
/* <Route path="/" component={() => <h1>匹配任意路径</h1>}></Route> */
